<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
  <div class="top">
    <div class="center">
      <h1><?php echo $heading_title; ?></h1>
    </div>
  </div>
  <div class="middle">
    <table class="list">
      <thead>
        <tr>
        <td class="left">编号</td>
        <td class="left">目录</td>
        <td class="left">操作</td>
        </tr>
      </thead>
      <tbody>
   <?php foreach ($categories as $category) { ?>
   <tr>
        <td class="left"><?php echo $category['id']; ?></td>
        <td class="right"><?php echo $category['name']; ?></td>
        <td class="center">[<a href="index.php?route=category/manger/edit&cat_id=<?php echo $category['id']; ?>">编辑</a>]</td>
    </tr>
    <?php } ?>
    </tbody>
          <tfoot>
        <?php foreach ($totals as $total) { ?>
        <tr>
          <td colspan="4"></td>
          <td class="right"><b><?php echo $total['title']; ?>:</b></td>
          <td class="right"><?php echo $total['text']; ?></td>
        </tr>
        <?php } ?>
      </tfoot>
    </table>
  </div>
  <div class="bottom">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center"></div>
  </div>
</div>
<script language="javascript">
    $(document).ready(function(){
        $("#update_category").click(function(){
        
            var cat_id = $("#update_category").attr("rel").val();
            alert(cat_id);
            $.ajax({
			url: 'index.php?route=category/list/update' + '&cat_id=' + cat_id +'',
			dataType: 'json',
			success: function(json) {
				if (json['success']) {
                        $('.success, .warning, .attention, .information').remove();
                        $('#notification').html('<div class="attention" style="display: none;">' + json['success'] + '<img src="home/view/image/close.png" alt="" class="close" /></div>');
                        $('.attention').fadeIn('slow');
                        $('html, body').animate({ scrollTop: 0 }, 'slow'); 
                    }
                }
            })
        })
    }
</script>
<?php echo $footer; ?> 